package com.itheima.mapper;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 部门管理的Mapper接口 -
 */

@Mapper
public interface DeptMapper {

    @Insert("insert into dept(id, name, create_time, update_time) values(#{id},#{name},#{createTime},#{updateTime})")
    void addDept(Dept dept);

    @Select("select * from dept")
    List<Dept> findAll();

    @Select("select * from dept where id=#{id}")
    Dept getById(Integer id);

    @Update("update dept set name=#{name}, update_time=#{updateTime} where id=#{id}")
    void updateById(Dept dept);

    @Delete("delete from dept where id=#{id}")
    void deleteById(Integer id);
}